#ifndef MAP_H
#define MAP_H

#include <curses.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "cell.h"
#include "character.h"

#define MAX_ROW_WIDTH 80

using std::string;
using std::ifstream;
using std::cout;
using std::endl;
using std::vector;

class Map {
  public:
    Map(const string& filename);
    bool loadFromFile(const string& filename);

    void display(WINDOW* w) const;

    int width() const;
    int height() const;

    bool inCollision(const Character* c) const;

  private:
    // Returns the number of rows added
    int addLineToMap(const string& line);

    bool is_loaded_;
    vector<vector<Cell> > data_;
};

#endif
